﻿
using EnergyExemplar.EntityFrameworkCore;
using EnergyExemplar.EntityFrameworkCore.DuckDb;
using Microsoft.EntityFrameworkCore;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations.Schema;

namespace cstdx.database;

public class CommonDbContext : DbContext
{

	private string _connstr {  get; set; }
	public CommonDbContext(string connstr)
	{
		_connstr = connstr;
	}

	protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
	{

		optionsBuilder.UseDuckDb(new DuckDbConnectionOptions { ConnectionString = _connstr});
		base.OnConfiguring(optionsBuilder);
	}

	public DbSet<AAA> AAAs {  get; set; }
	
}


[Table("AA")]
public class AAA
{
	public int Id { get; set; }
	public int Age { get; set; }
	public string Name { get; set; }
}